<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>拖放行为</title>
</head>
<body>
<div id="source" draggable="true" style="width:80px;height:60px;
    border:1px solid black;">拖动我</div>
<script type="text/javascript">
    var source = document.getElementById("source");
    var dest = document.getElementById("text");
    source.ondragstart = function(evt)
    {
        var dt = evt.dataTransfer;
        //可设置move、copy等属性值看看效果
        dt.effectAllowed = 'link';
        dt.setData("text/plain", "www.fkjava.org");
    }
    //允许拖动
    document.ondragover = function(e){return false};
</script>
</body>
</html>
